<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition template="./template.xhtml">

            <ui:define name="title">
                Send Report
            </ui:define>

            <ui:define name="content">
                <h:form prependId="false">
                    <table align="center" width="600px">
                        <tr>
                            <td colspan="2" align="center"><h3>New Report</h3></td><td></td>
                        </tr>
                        <tr>
                            <td colspan="3"><p:messages id="messages" showDetail="true" autoUpdate="true"  globalOnly="true"/></td>
                        </tr>
<!--                        <tr>
                            <td>Lab Name</td>
                            <td><h:selectOneMenu id="lid" value="" required="true" requiredMessage="Lab is empty !" valueChangeListener=""  >
                                    <f:selectItem itemLabel="Select" itemValue="" />
                                    <f:selectItems value="}" var="l" itemLabel="" itemValue="" />
                                </h:selectOneMenu></td>
                            <td><p:message for="lid" /></td>
                        </tr>-->
                        <tr>
                            <td>Device Name</td>
                            <td>
                                <h:selectOneMenu id="did" value="#{addReportBean.deviceid}" required="true" requiredMessage="Device is empty !">
                                    <f:selectItems value="#{addReportBean.devices}" var="d" itemLabel="#{d.devicename}" itemValue="#{d.deviceID}" />
                                </h:selectOneMenu>
                            </td>
                            <td><p:message for="did" /></td>
                        </tr>
                        <tr>
                            <td>Title</td>
                            <td><h:inputText id="title" value="#{addReportBean.title}" required="true" requiredMessage="Title invalid !" /></td>
                            <td><p:message for="title" /></td>
                        </tr>
                        <tr>
                            <td>Content</td>
                            <td><h:inputTextarea id="content" value="#{addReportBean.content}" required="true" requiredMessage="Content invalid !" /></td>
                            <td><p:message for="content" /></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td><h:commandButton value="Submit" action="#{addReportBean.resultAdd()}" /></td>
                            <td></td>
                        </tr>
                    </table>
                </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
